package com.zhuoyue.listener;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;


/**
 * @ClassName: GroupDelayTimeDeal
 * @Description: 消息队列,取消或者删除延时时间
 * @author wjming
 * @Date 2021-07-14 20:19
 */
@Component
@RabbitListener(queues = "${topic.rabbit.deviceDelayTime}")
public class GroupDelayTimeDeal {

    @Autowired
    private RedisTemplate redisTemplate;

    /**
     * 消息处理
     */
    @RabbitHandler
    public void groupLightDeal(String deviceMac) {
        redisTemplate.delete(deviceMac + "_delayTime");
        System.out.printf("延时取消成功");
    }

}
